package com.cheng.spring03.service.impl;

import com.cheng.spring03.dao.UserDao;
import com.cheng.spring03.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    @Override
    public void getAllUser() {
        if (true){
            throw new RuntimeException("手动抛出异常");
        }
        userDao.queryAllUser();
    }

    @Override
    public void addUser() {
        userDao.insertUser();
    }

    @Override
    public void removeUser() {
        userDao.deleteUser();
    }

    @Override
    public void modifyUser() {
        userDao.updateUser();
    }
}
